﻿#ifndef PST_Curve2DKeySelcetBar_h
#define PST_Curve2DKeySelcetBar_h

#include <QWidget>
#include <QScrollArea.h>
#include <QHBoxLayout>
#include <QLabel.h>
#include <QLineEdit.h>
#include <QPushButton.h>
#include "DataChosenListDialog.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Curve2DKeySelcetBar; };
QT_END_NAMESPACE

namespace pst
{
    class Curve2DKeySelcetBar :public QWidget
    {
        Q_OBJECT
    public:
        Curve2DKeySelcetBar(QWidget* parent = nullptr);
        ~Curve2DKeySelcetBar();

        void setData(const QString& keyName, const QList<double>& values);
        void setData(const QString& keyName, const QList<QString>& values);
        QList<int> getSelectedIndex();
        void setMultipleSelected(bool isMultipleSelected);
        void setPushButtonSelcetBarSelectState(bool isSelect, const QColor& color); // 设置selectBar是否为选中状态
        QString getLabelText(); //获取当前selectBar名称

    private:
        Ui::Curve2DKeySelcetBar* ui;

    public slots:
        void slot_selectDataButtonClicked();
        void slot_sentChosenDataIds(const QModelIndexList& chosenID);

    private:
        //QLabel* m_text;
        //QLineEdit* m_lineEdit;
        //QPushButton* m_button;
        DataChosenListDialog* m_dataChosenListDialog;
        QList<QString> m_values;
        QList<int> m_selectedIndexs;
        bool m_isMultipleSelected{true};
    };
}
#endif
